#include<stdio.h>
#include<assert.h>

void sum_arr(int arr[], int sz, int target)
{
    assert(arr);
    int sum = 0;
    int i = 0;
    int j = 0;
    for(i = 0; i < sz; i++)
    {
        for(j = i; j < sz; j++)
        {
            sum = arr[i] + arr[j];
            if(sum == target)
            {
                //printf("sum = %d, index = %d, %d\n", sum, i, j);
                printf("sum = %d, mem = %d, %d\n", sum, arr[i], arr[j]);
                break;
            }
            else;   
        }
    }
}

int main()
{
    int arr[10] = {1,2,3,4,5,6,7,8,9,10};
    int target = 9;
    int sz = sizeof(arr)/sizeof(arr[0]);
    sum_arr(arr, sz, target);


    return 0;
}